package com.wakaca.design.principle.singleresponsibility;

/**
 *
 * Created by wakaca
 */
public class Method {
    /** 多职责方法，更新用户名 和 更新地址 */
    private void updateUserInfo(String userName,String address){
        userName = "geely";
        address = "beijing";
    }

    /** properties代表还有其属性要更新，那么这个方法的职责就更多了，不一定更新什么 */
    private void updateUserInfo(String userName,String... properties){
        userName = "geely";
//        address = "beijing";
    }

    /** 这两个方法的职责是非常单一且清晰的 */
    private void updateUsername(String userName){
        userName = "geely";
    }
    private void updateUserAddress(String address){
        address = "beijing";
    }

    /** 这方法很明显的具有两个职责，我们应该把他们拆开 */
    private void updateUserInfo(String userName,String address,boolean bool){
        if(bool){
            //todo something1
        }else{
            //todo something2
        }

        userName = "geely";
        address = "beijing";
    }


}
